package com.tyfspring.context.support;

import com.tyfspring.beans.factory.DefaultListableBeanFactory;
import com.tyfspring.beans.support.XmlBeanDefinitionReader;

/**
 * @Description TODO
 * @Author shallow
 * @Date 2023/4/5 9:31
 */

public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext{
    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory,this);
        String[] configLocations = getConfigLocations();
        if (null!=configLocations) {
            beanDefinitionReader.loadBeanDefinitions(configLocations);
        }
    }

    protected abstract String[] getConfigLocations();
}
